<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>管理员首页</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
    <style>
        body { padding-top: 60px; }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href=" ">银行后台系统</a >
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown"
                aria-expanded="false" aria-label="切换导航">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNavDropdown">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <li class="nav-item"><a class="nav-link" href="/admin/customer">客户管理</a ></li>
                <li class="nav-item"><a class="nav-link" href="/admin/card/list">银行卡管理</a ></li>
                <li class="nav-item"><a class="nav-link" href="/admin/deposit/list">存款类型管理</a ></li>
                <li class="nav-item"><a class="nav-link" href="/trade/list">交易记录管理</a ></li>
            </ul>
            <span class="navbar-text text-white">管理员</span>
            <button class="btn btn-outline-light ms-3" onclick="logout()">退出</button>
        </div>
    </div>
</nav>

<div class="container">
    <div class="mt-5">
        <h2>欢迎进入管理员系统</h2>
        <p>请选择左上角导航菜单进行操作。</p >
    </div>
</div>

<script>
    function logout() {
        fetch('/auth/logout', {
            method: 'POST',
            headers: { token: localStorage.getItem("token") }
        }).then(() => {
            localStorage.removeItem("token");
            window.location.href = "/";
        });
    }
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>